<!DOCTYPE html>
<html>
<head>
    <title>通过第三方订单号退款</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <#include "../../../../include/resources.html">

        <script type="text/javascript">
            var search = function (){
                var data = {};
                if($("input[name='isDealLocal']").attr('checked')) {
                    data.isDealLocal = "Y";
                }
                data.searchName = $("input[name='searchName']").val();

                $.ajax({
                    url : '/modules/tpp/tppMerchantLog/sina/doSinaRefund.html?randomTime=' + (new Date()).getTime(),
                    dataType: "json",
                    data:data,
                    success : function(result){
                        var r = result || {};
                        $.messager.alert('提示', result.msg, 'info');
                    }
                });
            };

            var dataGrid;
            var winWidth =  900; //弹出窗口宽度
            var winHeight = 500; //弹出窗口高度
            $(function() {
                dataGrid = $('#dataGrid').datagrid({
                    url : '/modules/tpp/tppMerchantLog/sina/sinaRefundList.html',
                    fit : true,
                    fitColumns : true,
                    border : false,
                    pagination : true,
                    idField : 'id',
                    pageSize : pageSize,
                    pageNums :1,
                    pageList : pageList,
                    sortName : 'id',
                    sortOrder : 'asc',
                    checkOnSelect : false,
                    selectOnCheck : false,
                    nowrap : false,
                    singleSelect:true,
                    columns : [ [
                        { field: 'id', title: '编号', width: 60},
                        { field: 'tppType', title: '交易类型', width: 60,
                            formatter: function(value, row, index) {
                                if(row.tppType == "refund") {
                                    return "退款"
                                }else {
                                    return "其他"
                                }
                            }
                        },
                        { field: 'status', title: '状态', width: 60,
                            formatter:function(value,row,index){
                            if( row.status=='0') {
                                return '未处理';
                            }else if (row.status == "1"){
                                return '成功'
                            } else if(row.status == '2') {
                                return '失败'
                            }
                        }},
                        { field: 'toTppUserCustId', title: '收款方账户', width: 80},
                        { field: 'money', title: '金额', width: 60},
                        { field: 'orderId', title: '平台交易流水号', width: 80},
                        { field: 'subOrdId', title: '第三方订单号', width: 80},
                        { field: 'respDesc', title: '回调信息', width: 80},
                        { field: 'addTime', title: '操作时间', width: 150,formatter:function(value,row,index){
                            return getLocalTime(value,4);
                        }}
                    ] ],
                    toolbar : '#toolbar',
                    onLoadSuccess : function() {
                        $('#searchForm table').show();
                        parent.$.messager.progress('close');
                    }
                });
            });
            //重新触发按钮
            $("#refund").live("click",function(){
                search();
            })

        </script>
</head>
<body style="padding:0 20px;" >
<div class="easyui-layout" data-options="fit : true,border : false">
    <div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        <div class="sLeft">
            <form id="searchForm">
                <input type="text"  name="searchName" class="sInput" placeholder="输入第三方订单号" autocomplete="off" onkeydown="if(event.keyCode == 13){search();}"/>
                <input type="checkbox"  name="isDealLocal" class="sRadio" checked/><span>是否处理本地资金</span>
                <a href="javascript:void(0);" title="退款" class="sBtn" id="refund" >退款</a>
                <a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a>
                <a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
            </form>
        </div>
        <form id="showAdw">
        </form>
    </div>
    <div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
        <table id="dataGrid"></table>
    </div>
</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>